UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tCk6EAK/14DcLv41HE0yByqBtUD47oOnztYinS960YE='
WHERE
key_id = '97bbb1b8b2dd377c541613695ff259577d06a636c28ccad6eb1adc1921b96e95'
AND (
token = 'tCk6EAK/14DcLv41HE0yByqBtUD47oOnztYinS960YE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)