UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UwYx11Q6z5oJ/qqirhCwdLG9jwM+x4McDvmATa3ep1w='
WHERE
key_id = 'bbc6826919b4d5cf1481389a33872e664c8925b303b40aec22800edd062408b2'
AND (
token = 'UwYx11Q6z5oJ/qqirhCwdLG9jwM+x4McDvmATa3ep1w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)