UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'b1PaZbCKhcgaWsFFrlM2nhc2ul88RfvdYbbIhjz0iak=' 
WHERE 
  key_id = '4e999f90170ddc3bf423d0eba5c483ca5b5e14f4ec88b4481103f0d164eb25b0' 
  AND (
    token = 'b1PaZbCKhcgaWsFFrlM2nhc2ul88RfvdYbbIhjz0iak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054