UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Zv2kUJ01Lbln4GZpiPA7pJPBAdDCvwmQaQJnMCeD0Wg=' 
WHERE 
  key_id = 'afea9cae2dd585996ba969df1363902960d75dd7d9a572af7a07d5467e5a2cd0' 
  AND (
    token = 'Zv2kUJ01Lbln4GZpiPA7pJPBAdDCvwmQaQJnMCeD0Wg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025