UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'faQ2kaA1q5ZDX3KdkIs/4qA4yjWs3iTLWZdWUGAhM3E='
WHERE
key_id = 'edc0e9b470ab776fff8e6f486384548ae109d93b1ff3efedff11b08d96cb4c49'
AND (
token = 'faQ2kaA1q5ZDX3KdkIs/4qA4yjWs3iTLWZdWUGAhM3E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)