UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WywlZWlIHbpWIxbv2l8+RknGvsr1xepe8jdiZ0IQb1U='
WHERE
key_id = '3dfdbd88cbf8bf7eb12173b8253523d003be6556a199b14ce2ad614b5b35765d'
AND (
token = 'WywlZWlIHbpWIxbv2l8+RknGvsr1xepe8jdiZ0IQb1U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)