UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qGRJSyx27IW7qHTAuELhyAXdU8TjRKWL9IVxadaikQk='
WHERE
key_id = 'a92287c975710d5f77eaa0775445f1e2e6e6e8802c9573d1eb1a153e8a20f388'
AND (
token = 'qGRJSyx27IW7qHTAuELhyAXdU8TjRKWL9IVxadaikQk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)