UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QChWDpI3wttu0o+PvaE/wA0V4bsMaRVnXuljorvxjQc='
WHERE
key_id = '8102f4f2534a36e65f2ae0aebfb3267bf76cac8ad9b696ca614431c74ad5c3fb'
AND (
token = 'QChWDpI3wttu0o+PvaE/wA0V4bsMaRVnXuljorvxjQc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)