UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IBgjrZ9pdgDIYSxf6UCXgMdTT0aVSN72jGw4UzeFEPc='
WHERE
key_id = '76ce5f313b9912cd2d8b06db4751a2a89aa0f3e2268c5fc6c4eeaa5ad6aa596c'
AND (
token = 'IBgjrZ9pdgDIYSxf6UCXgMdTT0aVSN72jGw4UzeFEPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)