UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K/sgY4ZVikB5ahg2CiA3///K9MHvBnyjDmsh4hOufYo='
WHERE
key_id = '07fe40a5709eecd69c9843073a27066395676d4213a07bb04f80f851efa177a7'
AND (
token = 'K/sgY4ZVikB5ahg2CiA3///K9MHvBnyjDmsh4hOufYo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)