UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sVuuglkGSdAZ2Y9+UbMQbVcP7ni9HfBjNljyGqS5Q/U='
WHERE
key_id = '67d9463f3f28d971aca7b0bfd44f2449033146187755d8ab4989511be5f32318'
AND (
token = 'sVuuglkGSdAZ2Y9+UbMQbVcP7ni9HfBjNljyGqS5Q/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)