UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gP443MfPmyqn78D6xAmPQj+9vDpPFGJPrhJHOHok8w0=' 
WHERE 
  key_id = '731dbf3a6ea0d80aebcf672ff2f04de69c5b54a3f4b7df42b84ffdf69cd4ac19' 
  AND (
    token = 'gP443MfPmyqn78D6xAmPQj+9vDpPFGJPrhJHOHok8w0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022