UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ckLsIyirKNo+LU1otETOcPnCejXxV4jYebBhnh8MHDc='
WHERE
key_id = '7a39ea46b0c92795650db372d2a21273ed6b9def0465e896484daca96aea6833'
AND (
token = 'ckLsIyirKNo+LU1otETOcPnCejXxV4jYebBhnh8MHDc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)