UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xRH1Xc76KgicTS5W105xC/MrH/TJbG684up6A9z3f4s=' 
WHERE 
  key_id = '285a82b4bba9749191cfd889eeec4c3db59dedcee898ddbc727a89935fbf5627' 
  AND (
    token = 'xRH1Xc76KgicTS5W105xC/MrH/TJbG684up6A9z3f4s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029