UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Yp6Nnst3bWoLOZ/m/+a3k5XWHrRw1OWXFnPDzgATxe0=' 
WHERE 
  key_id = '6fa19a93f1a27656f92d444a8af5ee18efa07b014443e826fa45503fa7140ddb' 
  AND (
    token = 'Yp6Nnst3bWoLOZ/m/+a3k5XWHrRw1OWXFnPDzgATxe0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039