UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vIziWBnqllwfK+rLseJMUEdPXvMNIcoxCbv6KdGjNjA='
WHERE
key_id = 'ce4ad44314bcb56939b2810f462ce332ebc44c0b1f367c5759038cc6d220f48e'
AND (
token = 'vIziWBnqllwfK+rLseJMUEdPXvMNIcoxCbv6KdGjNjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)