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