UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4OM52DKTQ4EETBQ7AfWXFm5WdGRQcIZA6aPH46dbZC4='
WHERE
key_id = '9dff90eed301ff0b7bba1c0d23ffbd2328839060f6caa4a124f145ea68f93123'
AND (
token = '4OM52DKTQ4EETBQ7AfWXFm5WdGRQcIZA6aPH46dbZC4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)