UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IBxW/ZF2+Sh/AuHvR7xwHagKBK/bZ71Q4cAMsII9rm4=' 
WHERE 
  key_id = '7588cf9552f7e8819179ba6a33a65fbcb07ffe792c50173ecfc3bb0ab9cf3b5f' 
  AND (
    token = 'IBxW/ZF2+Sh/AuHvR7xwHagKBK/bZ71Q4cAMsII9rm4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028