UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mR/H/wYRE7hqgJxuZwAoAj2qZmR3qlR1WwsoMeK4zjA='
WHERE
key_id = '84572ed731df23aab24155872fae14b819263bbdc5d8922e544ac51da5683ce5'
AND (
token = 'mR/H/wYRE7hqgJxuZwAoAj2qZmR3qlR1WwsoMeK4zjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)