UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'R5+IMcLX32y2UdsdCpw+lBxW/Q2FMEtS1cJnr0RSHwU=' 
WHERE 
  key_id = '5d41bec9f9e8f91cd930d3dc9bb23892ac5c74a7811d5cef20148ade565c80ed' 
  AND (
    token = 'R5+IMcLX32y2UdsdCpw+lBxW/Q2FMEtS1cJnr0RSHwU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027