UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/0jX+KK/42fjEgjdXO0eWOThroCIbq15wN43OFu1Wh0=' 
WHERE 
  key_id = '2203dfa81ba6afccc4b3887c963d1c91553bc38fbf93a32754067a599701e922' 
  AND (
    token = '/0jX+KK/42fjEgjdXO0eWOThroCIbq15wN43OFu1Wh0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00048