UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mYgP+qQsquzkFNDdz8koeNIjqPK7OJYcvnrlzztve+o='
WHERE
key_id = '730bb0204b4332c059e22bf557f8c2f4aefcd5fb7569e2ab4af7d2a88b134899'
AND (
token = 'mYgP+qQsquzkFNDdz8koeNIjqPK7OJYcvnrlzztve+o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)