UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4kpsOZRowZjYVOwWMMOF99bAYNUcFm9o2KqhK7SVhOs='
WHERE
key_id = '983cbcf132181ad7c688e1f4c5a752fd572ea3351adae4222c4aa6a0b7710df2'
AND (
token = '4kpsOZRowZjYVOwWMMOF99bAYNUcFm9o2KqhK7SVhOs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)