UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/vPoeSpnf5f5YYpGPuCf7MKxA4kQKZ3hulusVFTdHu8='
WHERE
key_id = 'ebddb9391a8e91337dbefa9bf6f69fb8367f618228366513c9b16f1c3a723fc3'
AND (
token = '/vPoeSpnf5f5YYpGPuCf7MKxA4kQKZ3hulusVFTdHu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)