UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0+OGbe5SbX5pfWnmN7KyOQ/NrqskV0g14S++Di5JaVw='
WHERE
key_id = 'cd77cf90d960afc69393e0253d3875aa70b267244e5c6c0e44dfd9147c7d906c'
AND (
token = '0+OGbe5SbX5pfWnmN7KyOQ/NrqskV0g14S++Di5JaVw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)