UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8cyitK12+Ay2xFI8kFVkQbQuVmr6S91zfapRtYJBkw0=' 
WHERE 
  key_id = '700da5c648e7a0ab4b814af9a65655ee333355a41a94b50ed928fc513d27a167' 
  AND (
    token = '8cyitK12+Ay2xFI8kFVkQbQuVmr6S91zfapRtYJBkw0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029