UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DxfD7NnQH8WlPT+PdCzbSOL+ogGt4pZnUAdbTFvMIT8='
WHERE
key_id = '7a72590620b06e2d5eb26654e4567b61606184151a17849d4bf902e2d1435cc6'
AND (
token = 'DxfD7NnQH8WlPT+PdCzbSOL+ogGt4pZnUAdbTFvMIT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)