UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5+dKAsnk/I35Mkixqt/SEoFKXY5e6MMOTlKJ1R4P9Ks='
WHERE
key_id = '41bc518c4a8c3a0c55aaa9f6d1a2349d3844c968be1e089f45945be6452dbe3f'
AND (
token = '5+dKAsnk/I35Mkixqt/SEoFKXY5e6MMOTlKJ1R4P9Ks='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)