UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Abjk4LxZz4nQEjFd4BBdypWg2yVHNdcmpNt8HVng360=' 
WHERE 
  key_id = '2ccaac0eaeef8a6f2668eed56f83e764aae0d13702991c03f99d0acf8fcf7de5' 
  AND (
    token = 'Abjk4LxZz4nQEjFd4BBdypWg2yVHNdcmpNt8HVng360=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00094