UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Prdg51NhAf/mYnGvj21UWit/xdJOPJs7qAlu8lm3jnA='
WHERE
key_id = '19b0d7035a8a4c73de3c944961c889a0c0b883a5b5a7f33a005f23e314674f15'
AND (
token = 'Prdg51NhAf/mYnGvj21UWit/xdJOPJs7qAlu8lm3jnA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)