UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ijb4+y+q1qM1p/nSggtxrUuFfrOHt2/L0HsW71GdGcc=' 
WHERE 
  key_id = '8efb2511554e9d844ed7d4b723f683932a319a74a179491d02a7d4976a6675b9' 
  AND (
    token = 'ijb4+y+q1qM1p/nSggtxrUuFfrOHt2/L0HsW71GdGcc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047