UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tWTkQWHYNl/6GdzYfUTYoELQ9MFiyAVcbzT4OhnXzYE='
WHERE
key_id = 'd84214d0e2571bf7cfa6a4b1066307e7c2bb76623d9b3c6cea76cf58e92f0ea9'
AND (
token = 'tWTkQWHYNl/6GdzYfUTYoELQ9MFiyAVcbzT4OhnXzYE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)