UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'e4+59lCJ2mdAKZJKuvRia5EFoEVEyRttUcWy8enMuLM='
WHERE
key_id = '263a53ce773730a20ce9cb5bb3334d851a8d33a9e72870435127b6644d82ee4f'
AND (
token = 'e4+59lCJ2mdAKZJKuvRia5EFoEVEyRttUcWy8enMuLM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)