UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gIhf9wYUXpjGepgsREqFDsU46Rk+6mqzfXZYi/8U5gI='
WHERE
key_id = '3d47b6ca9570f95eb1c3ee2e437be23e81886d86df2ccbf93da94bd736c1d7d2'
AND (
token = 'gIhf9wYUXpjGepgsREqFDsU46Rk+6mqzfXZYi/8U5gI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)