UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'V43c9YL+Dm7O5SknorExzxtAjzB4V390xePVY5wd9zo=' 
WHERE 
  key_id = '37a9b2f274e4adda3da35ce12e7c4c68b8897712d4d1b50117f05aafbd10b12b' 
  AND (
    token = 'V43c9YL+Dm7O5SknorExzxtAjzB4V390xePVY5wd9zo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033