UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dXhe/F/UzPPYkAqlOP4Q1aqcv4bPd057QihukMUkp0w='
WHERE
key_id = '44f3fdda2e4e0c1a76db46e6453646998de6df60cc0db99fca069588652c2782'
AND (
token = 'dXhe/F/UzPPYkAqlOP4Q1aqcv4bPd057QihukMUkp0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)