UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FHAM5Vt9CQEG9MyrtpJX9htcguV+oFoTKaUcFeQN4ww=' 
WHERE 
  key_id = '13e29426c2ed608c40b15656a92315a8a1ebddd6e621f9ee5557f9678c7b7df6' 
  AND (
    token = 'FHAM5Vt9CQEG9MyrtpJX9htcguV+oFoTKaUcFeQN4ww=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025