UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3n2jCa1ydY6VXI/vUnwiZxfnAC75VSkx5PGD6khFQQY=' 
WHERE 
  key_id = '0aefbaa745e0cf6b91ff96b2e7e8da3a7024f5bb13b8caac6520cb707b86ebc4' 
  AND (
    token = '3n2jCa1ydY6VXI/vUnwiZxfnAC75VSkx5PGD6khFQQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019