UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VvrBD5NP3T6YiAjEHTB8WcDuWtu3HP5Z5sK9jW+yFDc=' 
WHERE 
  key_id = '44ddeda2cc1e2175f23ca7a261d75cb0ba7b31c3a1bcc76d2d8fcafa80f36705' 
  AND (
    token = 'VvrBD5NP3T6YiAjEHTB8WcDuWtu3HP5Z5sK9jW+yFDc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017