UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '58OQr4Iep81yaBrxV1lSsF05fgRzc3CxSrCpIf4jnxE='
WHERE
key_id = 'd855408c42c16aa90cbff3ba94825f57ba44c6df5ab0e4e8c9a1b0528b1724b8'
AND (
token = '58OQr4Iep81yaBrxV1lSsF05fgRzc3CxSrCpIf4jnxE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)