UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EYef++4KYbGgZABbvyoheKUNT+KHEA7vJbK8L80MxhY=' 
WHERE 
  key_id = '8cfaea980b156b19ced90c0f98648eca54f66e47518c3580ee2f596a2a952b9d' 
  AND (
    token = 'EYef++4KYbGgZABbvyoheKUNT+KHEA7vJbK8L80MxhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018