UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5mimrBRm7Fh2WWG4Ata8F/OVHFe0B3Zq79aUHKEJ/Vg=' 
WHERE 
  key_id = '392519743c7c9b956f45d19905b3e41309893fc32f33af6c6693d859c237fa11' 
  AND (
    token = '5mimrBRm7Fh2WWG4Ata8F/OVHFe0B3Zq79aUHKEJ/Vg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00119