UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qFetN0HGassH+bLc6fR9aiXoaCUsQCZxMn5mSc72yw4='
WHERE
key_id = '2b034712314dc2e40aaae5b84cb8ce097b7216cb676ebb482215279829b3e9a3'
AND (
token = 'qFetN0HGassH+bLc6fR9aiXoaCUsQCZxMn5mSc72yw4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)