UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'm6WfPhC+8XvSSUW6BwhmGByI4oKtiy+WGeU0b7tte/g='
WHERE
key_id = '2e7d363be02902910bd310de9660a0cd115342a35ac1e1f0bb75f80181b55359'
AND (
token = 'm6WfPhC+8XvSSUW6BwhmGByI4oKtiy+WGeU0b7tte/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)