UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X8E/6n0Q2nADpwX6jJn735vTvqn7mHH/LBQGdWk+sBQ='
WHERE
key_id = 'f3e57d1e526a3849687f3b3d308d75e95074041e209592c9e19c0b31b7eb3aa1'
AND (
token = 'X8E/6n0Q2nADpwX6jJn735vTvqn7mHH/LBQGdWk+sBQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)