UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BCOoRyVXpRF2fKC8KKXszzQ+T26Xe7HEGRQDGIlDG2c=' 
WHERE 
  key_id = '9a9e9fb2c95f8ad26347ef2a6cf67931fb5ac69539e0ff5d52539d600b49c323' 
  AND (
    token = 'BCOoRyVXpRF2fKC8KKXszzQ+T26Xe7HEGRQDGIlDG2c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041