UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '8mTSEaJZVVOPjWdCHK5KHzdDWD0/DQYF7FFPYGrgwsk='
WHERE
key_id = '48755979dbf2fc29b8678a28b1db7d752add20a6169e266c0da5d7de6a6f5844'
AND (
token = '8mTSEaJZVVOPjWdCHK5KHzdDWD0/DQYF7FFPYGrgwsk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)