UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bCTy3DkHSaA8BIY9VLd0g44yrIkNtKc87ws9bnKC/ac='
WHERE
key_id = 'ea1b28b077b16b58310473b67d23a0ff4e47697abcd04437c4dc101af2e4aaf2'
AND (
token = 'bCTy3DkHSaA8BIY9VLd0g44yrIkNtKc87ws9bnKC/ac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)