UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l2buRlhMtCbi5f8TytTmmDBuNLcJK9W4cB44ZaV1VI8='
WHERE
key_id = '0219ee222a7801be46c23d4bef46d149426515133a9ba5e75cd3acd4e44ae46a'
AND (
token = 'l2buRlhMtCbi5f8TytTmmDBuNLcJK9W4cB44ZaV1VI8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)